﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace EmailTest
{
    class Program
    {
        static string[] Receive = { "214936150@qq.com", "51944179@qq.com", "rogers1754@sina.com" };
        static void Main(string[] args)
        {
            using (System.IO.StreamReader sr = new System.IO.StreamReader(AppDomain.CurrentDomain.SetupInformation
                .ApplicationBase + "list.txt"))
            {
                string line = string.Empty;
                while (!String.IsNullOrEmpty(line = sr.ReadLine()))
                {
                    string[] item = line.Split(';');
                    try
                    {
                        foreach (var rc in Receive)
                        {
                            new ueEngine.Framework.Common.EMail(
                                new ueEngine.Framework.Common.EmailContext()
                                {
                                    Body = "test email",
                                    CredentialPassword = item[1],
                                    CredentialUserName = item[0],
                                    DisplayName = "重庆大学生兼职网",
                                    From = item[0],
                                    Recipient = rc,
                                    Subject = "邮件测试"
                                }).Send();
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(String.Format("{0}，发送失败。失败原因：{1}", item[0], e.ToString()));
                    }
                }

            }
            Console.WriteLine("over");
            Console.ReadKey();
        }
    }
    public class EmailTestItem
    {
        public string Address{get;set;}
        public string UserName{get;set;}
        public string Passsword{get;set;}
    }
}
